<?php
namespace app\admin\controller;
use \think\Controller;
use \think\Session;
use \think\Db;
class Showpic extends Common
{
	public function index(){
		if(input('method')=='0'||input('method')==''){
		$result = Db::name("pictures")->order('pi_id')->alias('a')->join('users b','a.u_id=b.u_id')->join('clubs c','a.c_id=c.c_id')->paginate(10);		
		}
		/*
		else if(input('method')=='1'){
			$result = Db::name("pictures")->order('pi_id')->alias('a')->join('users b','a.u_id=b.u_id')->join('clubs c','a.c_id=c.c_id')->where('b.u_name','like',"%".input('search')."%")->paginate(10);
		}else if(input('method')=='2'){
			$result = Db::name("pictures")->order('pi_id')->alias('a')->join('users b','a.u_id=b.u_id')->join('clubs c','a.c_id=c.c_id')->where('c.clubname','like',"%".input('search')."%")->paginate(10);
		}else if(input('method')=='3'){
			$result = Db::name("pictures")->order('showpicid')->alias('a')->join('user b','a.userid=b.userid')->join('club c','a.clubid=c.clubid')->where('showpiccontent','like',"%".input('search')."%")->paginate(10);
		}*/

		$this->assign('showpiclist',$result);
		return $this->fetch();

	}
	
	
}